{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Simple Scatter Plot with Labels\n",
    "===============================\n",
    "This example shows a basic scatter plot with labels created with Altair.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# category: basic charts\n",
    "import altair as alt\n",
    "alt.data_transformers.enable('json')\n",
    "import pandas as pd\n",
    "\n",
    "data = pd.DataFrame({\n",
    "    'x': [1, 3, 5, 7, 9],\n",
    "    'y': [1, 3, 5, 7, 9],\n",
    "    'label': ['A', 'B', 'C', 'D', 'E']\n",
    "})\n",
    "\n",
    "bars = alt.Chart(data).mark_point().encode(\n",
    "    x='x:Q',\n",
    "    y='y:Q'\n",
    ")\n",
    "\n",
    "text = bars.mark_text(\n",
    "    align='left',\n",
    "    baseline='middle',\n",
    "    dx=7\n",
    ").encode(\n",
    "    text='label'\n",
    ")\n",
    "\n",
    "bars + text\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "env": {},
   "interrupt_mode": "signal",
   "language": "python",
   "metadata": {},
   "name": "python3"
  },
  "language": "python"
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
